package com.stock_t.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.stock_t.entity.HistoricalPosition;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;

@Mapper
public interface HistoricalPositionMapper extends BaseMapper<HistoricalPosition> {
    
    /**
     * 分页查询历史持仓记录
     */
    IPage<HistoricalPosition> selectHistoricalPositionPage(Page<HistoricalPosition> page, 
                                                          @Param("startDate") Date startDate, 
                                                          @Param("endDate") Date endDate);
    
    /**
     * 根据日期范围查询记录数量
     */
    Long countByDateRange(@Param("startDate") Date startDate, 
                         @Param("endDate") Date endDate);
}